Skip to content

feat(cli): drop transparent curated ID-verb shadows (parity via #50)#51

Merged
ysyneu merged 1 commit into
feat/ai-srefrom
feat/cli-drop-idverb-shadows
Jun 15, 2026
Merged

feat(cli): drop transparent curated ID-verb shadows (parity via #50)#51
ysyneu merged 1 commit into
feat/ai-srefrom
feat/cli-drop-idverb-shadows

Conversation

@ysyneu

@ysyneu ysyneu commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

What

Drops curated shadow commands whose generated twins now have full parity after #50 (positional <id> args). The mechanism: genAddLeaf surfaces the generated leaf at the same name once the curated AddCommand(...) is removed (curated registers first via init() and wins on name-collision; generated is dropped). This continues the convergence on the generated single source.

Dropped (parity proven)

Each: generated twin has the same leaf name, the same SDK endpoint + *Request struct, positional <id> folds to the wire id field (#50), and generated flags ⊇ curated.

Command SDK endpoint Positional → wire Flag delta vs curated
incident ack POST /incident/ack (Incidents.Ack/AckIncidentRequest) incident_ids (slice, array-wins) +--incident-ids (curated had no flags)
incident unack POST /incident/unack (UnackIncidentRequest) incident_ids +--incident-ids
incident wake POST /incident/wake (WakeIncidentRequest) incident_ids +--incident-ids
incident reopen POST /incident/reopen (ReopenIncidentRequest) incident_ids +--incident-ids, +--reason (superset)
incident disable-merge POST /incident/disable-merge (DisableIncidentMergeRequest) incident_ids +--incident-ids
alert merge POST /alert/merge (Alerts.WriteMerge/AlertMergeRequest) alert_ids (slice) --incident--incident-id, +--comment/--alert-ids/--owner-id/--title

Flag-name deltas (CRITICAL — for the paired fc-safari doc migration)

  • alert merge: --incident (curated) → --incident-id (generated). Also gains superset --alert-ids, --owner-id, --title.
  • incident reopen gains a new optional --reason flag (superset, additive).

Accepted behavior deltas of converging on the generated single source

  • unack/wake/disable-merge lose the curated client-side ≤100-id cap; the backend still enforces it (help: "At most 100 per call").
  • alert merge loses MarkFlagRequired("incident"); incident_id stays required server-side.
  • Success line changes from the curated phrase (e.g. "Acknowledged N incident(s).") to the generic OK: POST <path> (in --json: {"message":"OK: POST <path>"}).

Held back (NOT dropped) + reasons

  • incident remove — curated has destructive-confirm (--force / interactive prompt); generated twin has none. Hidden curated-only safety value → KEEP.
  • incident snooze (--duration min-conversion + validation), incident comment (--comment 1024-char cap) — curated-only input semantics → KEEP.
  • incident get/detail (short-id resolve), timeline (per-id /incident/feed fan-out + operator-name enrichment), update (Reset + per-field FieldReset), merge/reassign/add-responder, war-room* — curated-only resolution/defaulting/enrichment → KEEP.
  • alert get/events/timeline — these are renames, not same-name shadows: the generated twins already coexist at alert info/event-list/feed. Do not drop. → recommended for a future generated-ALIAS approach (see below).
  • oncall schedule get (the prompt called this "schedule info") — premise did not hold. The curated command is oncall schedule get (under the oncall schedule group), while the generated schedule info is a top-level schedule command — different path and different name, so there is no shadow relationship and they already coexist. The curated get also carries curated-only value (person-name resolution via /person/infos, formatted detail block, computed-slots table). Dropping it would be a pure destructive removal with no same-path twin → KEEP. (Same class as the alert get renames; candidate for a future alias.)

Rename-via-alias recommendation (not implemented)

For the rename cases (alert getinfo, alert eventsevent-list, alert timelinefeed, and oncall schedule getschedule info), rather than dropping the rich curated command, add a thin alias on the generated leaf (cobra Aliases) — or register a curated-name alias pointing at the generated twin — so the familiar name keeps working without duplicating logic. Recommend, don't implement here.

Verification

  • go build -tags=jsoniter ./... clean; go test -tags=jsoniter ./... pass (migrated the unit + e2e assertions for the dropped commands to the generated twins' surface; dropped the unack/wake subtests of the 100-id-cap test since that cap is curated-only and intentionally gone).
  • Built binary confirms each dropped name resolves to its generated twin (help <group> <name> shows the API: POST <path> block; no-arg invocation triggers the generated requireArgs validator).
  • e2e set-diff vs origin/feat/ai-sre (testback localhost:11480): ZERO new failures. Both baseline and after have an identical 80-test failure set, all pre-existing NoLicense environment failures (the testback license gate rejects incident/change/escalation/statuspage APIs regardless of branch). comm -23 after baseline is empty.
  • Live wire spot-check: incident ack <id> reaches POST /incident/ack on testback (returns the same NoLicense env gate, proving the path is wired through the generated twin).

Drop the curated shadow commands whose generated twins now have full
parity after #50 (positional <id> args). genAddLeaf surfaces the
generated leaf at the same name once the curated AddCommand is removed.

Dropped (same generated name, same SDK endpoint, positional id folds to
the *_ids/_id wire field, generated flags ⊇ curated):

  incident ack         POST /incident/ack
  incident unack       POST /incident/unack
  incident wake        POST /incident/wake
  incident reopen      POST /incident/reopen  (+--reason, superset)
  incident disable-merge POST /incident/disable-merge
  alert merge          POST /alert/merge

Flag-name delta (for the paired docs migration):
  alert merge: curated --incident → generated --incident-id
               (also gains superset --alert-ids/--owner-id/--title)

Accepted deltas of converging on the generated single source:
  - unack/wake/disable-merge lose the curated client-side ≤100-id cap;
    the backend still enforces it (help: "At most 100 per call").
  - alert merge loses MarkFlagRequired("incident"); incident_id stays
    required server-side.
  - success line changes from the curated phrase to "OK: POST <path>".

validateIncidentIDBatch is kept (still used by comment/remove, which
stay curated for their --comment cap / destructive-confirm).

Tests: migrated the unit + e2e assertions for the dropped commands to
the generated twins' surface; dropped the unack/wake subtests of the
100-id-cap test (that cap is curated-only and intentionally gone).
@ysyneu ysyneu merged commit e6a8fa2 into feat/ai-sre Jun 15, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant